package practice.w912;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class CollectionToArray {
    public static void main(String[] args) {
        Collection<String> c = new ArrayList<>();
        c.add("hello");
        c.add("world");
        c.add("java");
        System.out.println(c);//[hello, world, java]
        String[] arr = c.toArray(new String[0]);
        System.out.println(Arrays.toString(arr));

    }
}
